import 'package:flutter/material.dart';

var simpleDialog = (context) async {
  var result = await showDialog(
      barrierDismissible: true, //表示点击灰色背景的时候是否消失弹出框
      context: context,
      builder: (context) {
        return SimpleDialog(
          title: const Text("请选择内容"),
          children: <Widget>[
            SimpleDialogOption(
              child: const Text("Option A"),
              onPressed: () {
                print("Option A");
                Navigator.pop(context, "A");
              },
            ),
            const Divider(),
            SimpleDialogOption(
              child: const Text("Option B"),
              onPressed: () {
                print("Option B");
                Navigator.pop(context, "B");
              },
            ),
            const Divider(),
            SimpleDialogOption(
              child: const Text("Option C"),
              onPressed: () {
                print("Option C");
                Navigator.pop(context, "C");
              },
            ),
          ],
        );
      });
  print(result);
};
